﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ВУИ
{
    public partial class Fpcr : Form
    {
        int id;
        int idd;
        Form1 Main;
        Lab l;
        public Fpcr(int ID, int IDD, Form1 MAIN, Lab L)
        {
            InitializeComponent();
            id = ID;
            idd = IDD;
            Main = MAIN;
            l = L;
            textBox1.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ВпгСреда;
            textBox2.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ВпгРез;
            textBox3.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ЦмвРез;
            textBox4.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ЦмвСреда;
            textBox5.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ХламидииРез;
            textBox6.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ХламидииСреда;
            textBox7.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ТоксоплазмаСреда;
            textBox8.Text = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ТоксоплазмаРез;
            dateTimePicker1.Value = Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].Дата;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ВпгСреда  = textBox1.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ВпгРез  = textBox2.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ЦмвРез  = textBox3.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ЦмвСреда  = textBox4.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ХламидииРез  = textBox5.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ХламидииСреда  = textBox6.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ТоксоплазмаСреда  = textBox7.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].ТоксоплазмаРез = textBox8.Text;
           Main.lPatient[Main.itnPatietn(id)].Labis.pcr[idd].Дата = dateTimePicker1.Value ;
           l.refresh();
           Close();

        }
    }
}
